/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Jose Krisbela
 */
@Entity
@Table(name = "pos_transaction_bonus_sales")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionBonusSales.findAll", query = "SELECT p FROM PosTransactionBonusSales p"),
//    @NamedQuery(name = "PosTransactionBonusSales.findBySync", query = "SELECT p FROM PosTransactionBonusSales p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionBonusSales.findByBonusSalesId", query = "SELECT p FROM PosTransactionBonusSales p WHERE p.bonusSalesId = :bonusSalesId"),
//    @NamedQuery(name = "PosTransactionBonusSales.findByBonusSalesFromDate", query = "SELECT p FROM PosTransactionBonusSales p WHERE p.bonusSalesFromDate = :bonusSalesFromDate"),
//    @NamedQuery(name = "PosTransactionBonusSales.findByBonusSalesToDate", query = "SELECT p FROM PosTransactionBonusSales p WHERE p.bonusSalesToDate = :bonusSalesToDate"),
//    @NamedQuery(name = "PosTransactionBonusSales.findByBonusSalesTotalSale", query = "SELECT p FROM PosTransactionBonusSales p WHERE p.bonusSalesTotalSale = :bonusSalesTotalSale"),
//    @NamedQuery(name = "PosTransactionBonusSales.findByBonusSalesNetSale", query = "SELECT p FROM PosTransactionBonusSales p WHERE p.bonusSalesNetSale = :bonusSalesNetSale"),
//    @NamedQuery(name = "PosTransactionBonusSales.findByBonusSalesNominal", query = "SELECT p FROM PosTransactionBonusSales p WHERE p.bonusSalesNominal = :bonusSalesNominal"),
//    @NamedQuery(name = "PosTransactionBonusSales.findByBonusSalesTimestamp", query = "SELECT p FROM PosTransactionBonusSales p WHERE p.bonusSalesTimestamp = :bonusSalesTimestamp")})
public class PosTransactionBonusSales implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "bonus_sales_id")
    private Integer bonusSalesId;
    @Column(name = "bonus_sales_from_date")
    @Temporal(TemporalType.DATE)
    private Date bonusSalesFromDate;
    @Column(name = "bonus_sales_to_date")
    @Temporal(TemporalType.DATE)
    private Date bonusSalesToDate;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "bonus_sales_total_sale")
    private BigDecimal bonusSalesTotalSale;
    @Column(name = "bonus_sales_nominal")
    private BigDecimal bonusSalesNominal;
    @Column(name = "bonus_sales_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date bonusSalesTimestamp;
    @JoinColumn(name = "bonus_sales_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private MasterUnit bonusSalesUnitId;
    @JoinColumn(name = "bonus_sales_sales_id", referencedColumnName = "sales_id")
    @ManyToOne(optional = false)
    private PosMasterSales bonusSalesSalesId;

    public PosTransactionBonusSales() {
    }

    public PosTransactionBonusSales(Integer bonusSalesId) {
        this.bonusSalesId = bonusSalesId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getBonusSalesId() {
        return bonusSalesId;
    }

    public void setBonusSalesId(Integer bonusSalesId) {
        this.bonusSalesId = bonusSalesId;
    }

    public Date getBonusSalesFromDate() {
        return bonusSalesFromDate;
    }

    public void setBonusSalesFromDate(Date bonusSalesFromDate) {
        this.bonusSalesFromDate = bonusSalesFromDate;
    }

    public Date getBonusSalesToDate() {
        return bonusSalesToDate;
    }

    public void setBonusSalesToDate(Date bonusSalesToDate) {
        this.bonusSalesToDate = bonusSalesToDate;
    }

    public BigDecimal getBonusSalesTotalSale() {
        return bonusSalesTotalSale;
    }

    public void setBonusSalesTotalSale(BigDecimal bonusSalesTotalSale) {
        this.bonusSalesTotalSale = bonusSalesTotalSale;
    }



    public BigDecimal getBonusSalesNominal() {
        return bonusSalesNominal;
    }

    public void setBonusSalesNominal(BigDecimal bonusSalesNominal) {
        this.bonusSalesNominal = bonusSalesNominal;
    }

    public Date getBonusSalesTimestamp() {
        return bonusSalesTimestamp;
    }

    public void setBonusSalesTimestamp(Date bonusSalesTimestamp) {
        this.bonusSalesTimestamp = bonusSalesTimestamp;
    }

    public MasterUnit getBonusSalesUnitId() {
        return bonusSalesUnitId;
    }

    public void setBonusSalesUnitId(MasterUnit bonusSalesUnitId) {
        this.bonusSalesUnitId = bonusSalesUnitId;
    }

    public PosMasterSales getBonusSalesSalesId() {
        return bonusSalesSalesId;
    }

    public void setBonusSalesSalesId(PosMasterSales bonusSalesSalesId) {
        this.bonusSalesSalesId = bonusSalesSalesId;
    }
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (bonusSalesId != null ? bonusSalesId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionBonusSales)) {
            return false;
        }
        PosTransactionBonusSales other = (PosTransactionBonusSales) object;
        if ((this.bonusSalesId == null && other.bonusSalesId != null) || (this.bonusSalesId != null && !this.bonusSalesId.equals(other.bonusSalesId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionBonusSales[ bonusSalesId=" + bonusSalesId + " ]";
    }
    
}
